---
title: "Signals"
description: "Signal handling for graceful server shutdown API Documentation"
icon: "code"
github: "https://github.com/mcp-use/mcp-use/blob/main/libraries/python/mcp_use/server/utils/signals.py"
---

import {RandomGradientBackground} from "/snippets/gradient.jsx"

<Callout type="info" title="Source Code">
View the source code for this module on GitHub: <a href='https://github.com/mcp-use/mcp-use/blob/main/libraries/python/mcp_use/server/utils/signals.py' target='_blank' rel='noopener noreferrer'>https://github.com/mcp-use/mcp-use/blob/main/libraries/python/mcp_use/server/utils/signals.py</a>
</Callout>

Signal handling for graceful server shutdown.


## setup_signal_handlers
<Card type="info">
### `function` setup_signal_handlers

Set up signal handlers for immediate shutdown.

```python
from mcp_use.server.utils.signals import setup_signal_handlers
```

**Signature**
```python wrap
def setup_signal_handlers():
```

</Card>
